#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/9/3 15:10
# @Author : 吴敬超
# explain:
import netCDF4 as nc

# URL of an OpenDAP  OpenDAP 的url可以
file_path = 'http://192.168.22.44:8080/thredds/dodsC/treefile/oceansnap/ocean_snap_salt_2018_02_01.nc'

file_obj = nc.Dataset(file_path)
# 分片读取，每个维度读一部分
salt = file_obj.variables['salt'][0,0, 2500:2510, 11500:11600]
print salt
file_obj.close()
